/**
 * Copyright (c) 快宝网络 kuaidihelp.com Co., Ltd. All Rights Reserved 禁止外泄以及用于其它的商业用途
 */

import { Request, Response } from 'express';
import { ResponseItem, responseSuccess } from '../utils';
import Mock from 'mockjs';

export default {
  'POST /android/vb': (req: Request, res: Response, u: string) => {
    const info = Array.from({ length: 20 }).map((_, index) => {
      return Mock.mock({
        id: '@id()',
        app_v: '@id()',
        path_v: '@cname()',
        shop_v: '@cname()',
        url: 'url',
        'appname|1': ['Y', 'N', 'J', 'Z', 'U'],
        detail: '详情',
      });
    });

    const result: ResponseItem = {
      code: 0,
      msg: '成功',
      data: { info },
    };
    return res.json(result);
  },
  'POST /android/upload': (req: Request, res: Response) => responseSuccess(req, res),
  'POST /android/yan': (req: Request, res: Response) => responseSuccess(req, res),
};
